<?php

namespace Xin\Plugin\Contracts;

interface Plugin
{

    /**
     * 插件安装
     *
     * @param \Xin\Plugin\Contracts\PluginInfo $pluginInfo
     * @param \Xin\Plugin\Contracts\Factory $pluginManager
     * @return boolean
     */
    public function install(PluginInfo $pluginInfo, Factory $pluginManager);

    /**
     * 插件卸载
     *
     * @param \Xin\Plugin\Contracts\PluginInfo $pluginInfo
     * @param \Xin\Plugin\Contracts\Factory $pluginManager
     * @return boolean
     */
    public function uninstall(PluginInfo $pluginInfo, Factory $pluginManager);

    /**
     * 插件升级
     *
     * @param \Xin\Plugin\Contracts\PluginInfo $pluginInfo
     * @param \Xin\Plugin\Contracts\Factory $pluginManager
     * @param string $version
     * @return boolean
     */
    public function upgrade(PluginInfo $pluginInfo, Factory $pluginManager, $version);

    /**
     * 启动插件
     *
     * @param \Xin\Plugin\Contracts\PluginInfo $pluginInfo
     * @param \Xin\Plugin\Contracts\Factory $pluginManager
     * @return mixed
     */
    public function boot(PluginInfo $pluginInfo, Factory $pluginManager);

}
